import http from './http'
//const AUTH_TOKEN = "Authorization";

// http.setBaseUrl("https://api.2598.life/");
// http.setBaseUrl("https://api.uefa.co");
// http.setBaseUrl("http://localhost:9790");
// http.setBaseUrl("http://192.168.99.124:9790");
// http.setBaseUrl("http://192.168.99.123:9790");
// http.setBaseUrl("http://192.168.99.153:9790");
// http.setBaseUrl("https://dingbao.bhxww.com");
http.setBaseUrl("https://dingbao.gxbhxww.cn");

http.beforeResponseFilter = function(res) {
	//X-Auth-Token
	/*
    if (res.header) {
        var respXAuthToken = res.header[AUTH_TOKEN.toLocaleLowerCase()];
        if (respXAuthToken) {
            uni.setStorageSync(AUTH_TOKEN, respXAuthToken);
            http.header[AUTH_TOKEN] = respXAuthToken;
        }
    }*/
	if (res.statusCode == 401 || (res.data && res.data.code == 40001)) {
		uni.removeStorageSync('userInfo')
		uni.removeStorageSync('token')
		uni.removeStorageSync('isLogin')

	}
	return res;
}


let my = {
	'http': http
}

export default my
